# -*- coding:utf-8 -*-
"""
@Time : 2025/01/17 07:06 AM
@Author: xiaomi
@Des: schemas模型
"""
from datetime import datetime
from pydantic import Field, BaseModel, field_validator
from typing import Optional, List, Tuple, Union
from schemas.base import BaseResp, ResAntTable


class CreateAd(BaseModel):
    title: str = Field(min_length=2, max_length=255)
    data_list: Optional[str] = None
    sort: Optional[int] = 0
    status: Optional[bool] = False

class UpdateAd(BaseModel):
    id: int
    title: Optional[str] = Field(min_length=2, max_length=255)
    data_list: Optional[str] = None
    sort: Optional[int] = 0
    status: Optional[bool] = False

class DeleteAd(BaseModel):
    key: List[int] = Field(default=[], description="广告集合")

class AdItem(BaseModel):
    pic: str
    link: Optional[str] = None
    title: Optional[str] = None

class AdListData(BaseResp):
    data: List[AdItem]


